<!DOCTYPE html>
<html xmlns:v-bind="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="utf-8">
    <title>条件渲染</title>
    <script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
</head>

<body>
<div id="app">
    <div v-if="isShow">hello vue</div>
    <template v-if="isShow">
        <p>hello</p>
        <div>hello javaboy</div>
        <span>hhhh</span>
    </template>
    <div v-else="isShow">
        <p>江南</p>
    </div>
    性别：
    <div v-if='gender==0'>男</div>
    <div v-else-if="gender==1">女</div>
    <div v-else>未知</div>
    <hr>
    <template v-if="loginType=='username'">
        <label>用户名1</label>
        <!--<input type="text" placeholder="请输入用户名">-->
        <input type="text" placeholder="请输入用户名" key="username">
    </template>
    <template v-else>
        <label>用户名2</label>
        <!--<input type="text" placeholder="请输入用户邮箱地址">-->
        <input type="text" placeholder="请输入用户邮箱地址" key="email">
    </template>
</div>


</body>


<script>
    var app = new Vue({
        el: '#app',
        data: {
            msg: 'hhh',
            isShow: true,
            gender: 0,
            loginType: "usernam"
        }
    })

</script>
</html>
